<template>
    <span class="sort" @click="sort"><Icon type="md-repeat" /> {{sort_title}}</span>
</template>
<script>
import conferenceService from '@/service/t_conference'
export default {
    data(){
        return{
            order_flag:false,
        }
    },
    props: ['sort_title','sort_key','sort_list','sort_index'],
    methods:{
        sort(){
            if(this.order_flag){
                conferenceService.getTConferenceList({
                    order:[[this.sort_key,1]],
                    pageNumber:1,
                    pageSize:20,
                    // columns: ['id', 'ming_cheng', 'di_dian', 'jie_shu', 'ju_ban_dan_wei', 'wang_zhan', 'ju_ban_shi_jian','suo_shu_zi_ling_yu'],
                }).then(res => {
                    this.$emit('update:sort_list',res.data);
                });
            }else{
                conferenceService.getTConferenceList({
                    order:[[this.sort_key,0]],
                    pageNumber:1,
                    pageSize:20,
                    // columns: ['id', 'ming_cheng', 'di_dian', 'jie_shu', 'ju_ban_dan_wei', 'wang_zhan', 'ju_ban_shi_jian','suo_shu_zi_ling_yu'],
                }).then(res => {
                    this.$emit('update:sort_list',res.data);
                });
            }
            this.order_flag = !this.order_flag; 
        }
    }
}
</script>
<style lang="scss" scoped>
.sort{
    font-size: 17px;
    font-weight: normal;
    padding: 8px 8px;
    margin-left: 15px;
    color: #888;
    cursor: pointer;
    user-select:none;
    // border-radius: 3px;
    transition: color 0.2s ease;
    font-size: 15px;
}
.sort-icon{
    transition: all 0.2s ease;
}
.sort:hover{
    color: #83a2f1;
}
</style>